﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace VkontakteAgent
{
    public partial class LoginForm : Form
    {
        public LoginForm()
        {
            InitializeComponent();
        }

        private void btnExit_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void btnLogin_Click(object sender, EventArgs e)
        {
            UserAPI u = new UserAPI(textBox1.Text, textBox2.Text);
            if (u.sid == "-4")
            {
                System.Windows.Forms.MessageBox.Show("Неправильная пара email/пароль!!!");
            }
            else
            {
                this.Hide();
                MainForm form1 = new MainForm(u);
                form1.Show();
            }
        }
    }
}
